<template>
	<view class="tabBar">
		<view class="tabBar-item active">
			<image src="../static/icon/home.svg" v-if="current=='home'" mode=""></image>
			<image src="../static/icon/home-org.svg" v-else mode=""></image>
			<text>首页</text>
		</view>
		<navigator url="/pages/mall/index/index">
			<view class="tabBar-item">
				<image src="../static/icon/mall-org.svg" mode=""></image>
				<text>商城</text>
			</view>
		</navigator>
		<view class="tabBar-item">
			<view class="call">
				<image src="../static/icon/call-org.svg" mode=""></image>
			</view>			
			<text>客服</text>
		</view>
		<navigator url="/pages/mall/cart/cart">
			<view class="tabBar-item">
				<view class="dot">
					10
				</view>
				<image src="../static/icon/mall-org.svg" mode=""></image>
				<text>购物车</text>
			</view>
		</navigator>
		<view class="tabBar-item">
			<image src="../static/icon/usercenter.svg" v-if="current=='user'" mode=""></image>
			<image src="../static/icon/usercenter-org.svg" v-else mode=""></image>
			<text>我的</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"tabBar",
		props: {
			current: {
				type: String,
				default:'home'
			}
		},
		data() {
			return {
				
			};
		},
		created() {
		}
	}
</script>

<style lang="scss">
.tabBar {
	position: fixed;
	bottom: 0;
	width: 100%;
	height: 120rpx;
	background-color: #fff;
	z-index: 99;
	display: flex;
	justify-content: space-around;
	overflow: visible;
	&-item {
		width: 100rpx;
		height: 100rpx;
		display: flex;
		flex-direction: column;
		text-align: center;
		justify-content: space-between;
		padding: 10rpx 0;
		position: relative;
		&>image {
			width: 60rpx;
			height: 60rpx;
			display: block;
			margin: 10rpx auto;
		}
		&>text {
			color: #a6a6a6;
			font-size: 30rpx;
		}
	}
}
.call {
	width: 100rpx;
	height: 100rpx;
	margin-top: -50rpx;
	background-color: #fff;
	border-radius: 50%;
	box-shadow: 0 10rpx #a6a6a6;
	&>image {
		width: 60rpx;
		height: 60rpx;
		display: block;
		margin: 25rpx auto;
	}
}
.dot {
	position: absolute;
	width: 25rpx;
	height: 25rpx;
	top: 15rpx;
	left: 20rpx;
	background-color: red;
	border-radius: 50%;
	color: #fff;
	font-size: 15rpx;
	line-height: 25rpx;
	text-align: center;
}
.active {
	&>text {
		color: #088820;
	}		
}
</style>